using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;

namespace IGGCore
{
    public class Linescore
    {
        private Team m_awayTeam;
        private Team m_homeTeam;
        private int m_diff;
        private Dictionary<Team, TeamLineScore> m_scores;
        private List<Inning> m_innings;

        public List<Inning> Innings
        {
            get { return m_innings; }
        }

        public int Diff
        {
            get { return m_diff; }
            set { m_diff = value; }
        }

        public Linescore(Team awayTeam, Team homeTeam)
        {
            m_scores = new Dictionary<Team, TeamLineScore>();
            m_innings = new List<Inning>();

            m_awayTeam = awayTeam;
            m_homeTeam = homeTeam;
            m_scores.Add(m_awayTeam, new TeamLineScore());
            m_scores.Add(m_homeTeam, new TeamLineScore());
        }

        public void AddInning(int away, int home)
        {
            m_innings.Add(new Inning(away, home));
        }

        public TeamLineScore GetAwayLineScore()
        {
            return m_scores[m_awayTeam];
        }

        public TeamLineScore GetHomeLineScore()
        {
            return m_scores[m_homeTeam];
        }

        public TeamLineScore GetTeamLineScore(Team team)
        {
            return m_scores[team];
        }

    }
}
